package week03;

import java.util.Scanner;

	public class week0301 {
		public static class Person {
			private String name;
			private boolean gender;
			private int age;
			private int id;
			public Person() {
				System.out.println("This is constructor");
				System.out.println(name+","+age+","+gender+","+id);
			}
			public Person(String name,int age,Boolean gender) {
				this.name=name;
				this.gender = gender;
				this.age = age;
				
			}
			@Override
			public String toString() {
				return "Person [name=" + name + ", age=" + age + ", gender=" + gender + ", id=" + id + "]";
			}
			public String getName() {
				return name;
			}
			public void setName(String name) {
				this.name = name;
			}
			public boolean isGender() {
				return gender;
			}
			public void setGender(boolean gender) {
				this.gender = gender;
			}
			public int getAge() {
				return age;
			}
			public void setAge(int age) {
				this.age = age;
			}
			public int getId() {
				return id;
			}
			public void setId(int id) {
				this.id = id;
			}
			
		}
		public static void main(String[] args) {
			Scanner in = new Scanner(System.in);
			int n = in.nextInt();
			Person[] p = new Person[n];
			for(int i = 0;i<n;i++) {
				String name2 = in.next();
				int age2 = in.nextInt();
				Boolean gender2 = in.nextBoolean();
				p[i] = new Person(name2,age2,gender2);
			}
			for(int i = n-1;i>=0;i--) {
				System.out.println(p[i].toString());
			}
			Person test = new Person();
			System.out.println(test.toString());
		}
			
	}

